The present invention relates to clip and gain circuits, and more particularly to a digital clip and gain circuit for generating a new control waveform from an input waveform.
In the television arts clip and gain circuits are used for video processing where an input waveform is compared with a reference level and the difference value is amplified, level shifted and limited to generate a control waveform. A typical clip and gain circuit is shown in FIG. 1. Typical examples of applications for clip and gain circuits are "wipe", "self-key" and "depth" effects.
A wipe is a method by which two video pictures are combined into one output picture by spatially dividing the output into two or more separate spaces, each of which contains the corresponding video from one of the inputs. FIG. 2 shows a simple "split-screen" wipe, where the left side of the output picture consists of the left side of a first input and the right side of the output picture consists of the right side of a second input. This effect is accomplished by first generating a ramp waveform which is a low voltage in areas corresponding to the left side of the picture and a high voltage in areas corresponding to the right side of the picture, as illustrated in FIG. 3. This waveform becomes the input to the clip and gain circuit where it is compared with a reference, or clip, voltage and the difference value is amplified. After level shifting and limiting to an appropriate range, the resulting output may be used to drive the control input of a mixer whose two inputs are the two pictures.
In areas where the ramp waveform is much lower than the clip voltage, the output of the comparator, or subtracter, is negative. The negative output is amplified and converted to a control voltage which enables the mixer to turn on the first picture's video. Conversely, where the ramp waveform is much higher than the clip voltage, the output of the comparator is positive. The positive output is similarly converted to a control voltage which enables the mixer to turn on the second picture's video. When the ramp waveform is close in level to the clip voltage, the output of the comparator is close to zero which, depending upon the gain of the amplifier, may not result in an output level that fully drives the mixer fully to either limit, i.e., the mixer outputs some proportional mix of the two input pictures. This proportional mixing, which occurs at the boundaries between two pictures, is called "softness" and provides for a graceful transition from one picture to another. The width of the softness region depends on the gain of the amplifier and the slope of the ramp waveform. By providing operator control over the gain and clip settings the transition region may be moved left to right in space and its width may be varied.
In the self-key example one of the two inputs to the mixer is also an input to the comparator, as shown in FIG. 4. When the level in the picture is below that of the clip voltage, the resulting control waveform causes the mixer to output the first picture, and when the level in the picture is above the clip voltage, the resulting control waveform causes the mixer to output the second picture. In this way bright, or high level, areas of the second picture take priority over the first picture's video, while dark, or low level, areas of the second picture are subordinated to the first picture. If the second picture is lettering on a dark background as shown in FIG. 5, then the resulting picture is those letters over the first picture.
In another example the input waveform is a signal whose voltage is proportional to the second picture's depth, or apparent distance from the viewer in the picture, or an object in the picture. When the input waveform is generated such that "near" depths are high levels and "far" depths are low levels relative to the clip voltage, the second picture is made to "disappear" into the first picture. In this case the clip voltage represents a depth beyond which the viewer could not see the second picture. By reducing the gain of the amplifier such that the transition distance is quite large, a gradual "fading" of the second picture results as it appears to recede from the viewer, enhancing the illusion of depth.
In conventional analog implementations the major design obstacle is noise, since any noise appearing on the input waveform near the clip voltage is amplified and causes false or uneven mixing between the two pictures at the transition point. In digital systems random noise is less of a problem, especially if the input waveform has been digitally generated, but the input waveform must generally be represented by many bits to avoid similar effects due to quantization noise. If not enough precision is used for the input waveform representation, a gain large enough to make the desired small transition region uses up all of the bits and the output of the control waveform to the mixer jumps from the off, picture one, level to the on, picture two, level without any intervening steps. On diagonal edges this causes the transition to look "jaggy", or stair-stepped, instead of a more pleasing fade from one picture to the other. As the number of bits used in the input waveform increases, this distortion becomes less pronounced, but the cost of the clip and gain circuit rises due to the complexity and cost of a larger multiplier.
Another implementation difficulty in digital systems is the desire to have a wide range of gain values. A typical clip and gain circuit has gain values as low as 0.00, circuit off, and as high as 512.0 to 1024.0. Additionally the fractional precision needed at small gains is high, often eight or more bits, to avoid "cogging", or a noticeable jump in transition width as the gain is smoothly varied. The combined number of bits required for the range and fraction precision of the gain values also makes the circuit more costly and complex. This is particularly true of the gain multiplier since the number of bits required at the output of the multiplier is the sum of the number of bits at the two inputs. For a typical circuit the input waveform may need as many as twenty bits, which becomes twenty-one after the comparator, and the gain value may need as many as eighteen bits for an output precision of thirty-eight bits. A typical mixer control waveform is only ten bits, but the full thirty-eight bits must be generated to insure that over range values are properly limit detected and clipped.
What is desired is a digital clip and gain circuit which minimizes jaggies and cogging without the need for wide dynamic range multipliers to reduce the cost and complexity of the implementation.